package asedra.huyle.dto;

import java.util.Date;

import android.database.Cursor;

public class Match extends BaseDto{

	public static final String TABLE_NAME = "match";

	public static final String MATCH_ID = "m_id";

	public static final String DATE = "date";

	public static final String DESCRIPTION = "description";

	public static final String TITLE = "title";

	public static final String[] COLUMNS = new String[]{MATCH_ID, DATE, DESCRIPTION, TITLE};

	public static final String DEFAULT_SORT_ORDER = MATCH_ID + " ASC";
	
	private int matchId;
	private Date date = new Date();
	private String description;
	private String title;
	
	public Match() {
		super();
	}
	
	public Match(Cursor c) {
		super();
		this.matchId = c.getInt(c.getColumnIndex(MATCH_ID));
		String dateStr = c.getString(c.getColumnIndex(DATE));
		this.date = new Date(Date.parse(dateStr));
		this.description = c.getString(c.getColumnIndex(DESCRIPTION));
		this.title = c.getString(c.getColumnIndex(TITLE));
	}

	public Match(int matchId, Date date, String description, String title) {
		super();
		this.matchId = matchId;
		this.date = date;
		this.description = description;
		this.title = title;
	}

	public int getMatchId() {
		return matchId;
	}

	public void setMatchId(int matchId) {
		this.matchId = matchId;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
}
